class ComplexNumber{
	int a,b;
	ComplexNumber(int a,int b){  
		this.a = a;		this.b = b;		
	}
	void print(){		
		System.out.println(a + "+" + b + "i");	
	}
	ComplexNumber add(ComplexNumber c){
		this.a += c.a;		this.b += c.b;
		return this;
	}
	public static void main (String[] args) {		
		ComplexNumber c0 = new ComplexNumber(0,0);
		ComplexNumber c1 = new ComplexNumber(5,6);
		ComplexNumber c2 = new ComplexNumber(7,8);
		ComplexNumber c3 = new ComplexNumber(9,10);
		ComplexNumber c4 = c0.add(c1).add(c2).add(c3);	/*...*/	
		c4.print();
	}
}